﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace temaIp
{
    class Client
    {
        private string name;
        private int age;
        private static readonly List<AbstractCar> list = new List<AbstractCar>();

        public Client() {}
        public string getName()
        {
            return name;
        }
        public void setName(string name1)
        {
            name = name1;
        }
        public void setAge(int age1)
        {
            age = age1;
        }
        public void add(AbstractCar car)
        {
            list.Add(car);
        }
        public void remove(string carName)
        {
            int i = 0;
            foreach ( AbstractCar masina in list )
                if (i < 1)
                if (masina.getName().Equals(carName))
                {
                    i++;
                    list.Remove(masina);
                }
        }
        public void show()
        {
            foreach (AbstractCar car in list)
                car.show();
        }
        public void showList()
        {
            foreach (AbstractCar car in list)
                System.Console.WriteLine(car.getName());
        }
        public void showDetails()
        {
            System.Console.WriteLine("Numele clientului este: ");
            System.Console.WriteLine(name);
            System.Console.WriteLine("Varsta clientului este: ");
            System.Console.WriteLine(age.ToString());
        }

    }
}
